package legumes.client.services.callbacks;

import legumes.client.services.LegumesServicesHelper;
import legumes.client.services.util.rpc.SequencableRPCCall;
import legumes.shared.domain.SellSession;
import legumes.shared.domain.Store;

public class NewSellSessionCallback extends SequencableRPCCall<SellSession> {

	private Store store;
	private SellSession newSellSession;
	private long fromSellSessionId;

	public NewSellSessionCallback(Store store_, long fromSellSessionId_) {
		store = store_;
		fromSellSessionId = fromSellSessionId_;
	}

	@Override
	protected void doCall() {
		LegumesServicesHelper.LEGUMES_SERVICES.newSellSession(
				store, fromSellSessionId, this);
	}

	public void onSuccess(SellSession sellSession_) {
		newSellSession = sellSession_;
		callNext();
	}

	public SellSession getNewSellSession() {
		return newSellSession;
	}

	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

}
